package com.smarttiger.zero.admin.entity;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "usersGroup")
public class UsersGroupModel extends BaseEntity {


    @Column(name = "name", length = 100)
    private String name;

    @Column(name = "code", length = 100)
    private String code;

    @Column(name = "note")
    private String note;

    @ManyToMany(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinTable(name = "users_usersGroup",
            joinColumns = @JoinColumn(name="userGroupId",referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "usersId",referencedColumnName = "id"))
    private List<UsersModel> usersModelList;

    public List<UsersModel> getUsersModelList() {
        return usersModelList;
    }

    public void setUsersModelList(List<UsersModel> usersModelList) {
        this.usersModelList = usersModelList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
